package jwr.basic;

public class Ex72_OOP {

	public static void main(String[] args) {
		
		Ex72_Retangle ret = new Ex72_Retangle();
		Ex73_Fan fan = new Ex73_Fan();
		Ex74_Acconut acc = new Ex74_Acconut();
		Ex75_Stock stk = new Ex75_Stock();
		
		System.out.println(ret.width);
		System.out.println(ret.height);
		System.out.println(ret.color);
		System.out.println(ret.getArea());
		System.out.println(ret.getCircum());
		System.out.println();
		
		ret = new Ex72_Retangle(4, 40, "red");
		System.out.println(ret.width);
		System.out.println(ret.height);
		System.out.println(ret.color);
		System.out.println(ret.getArea());
		System.out.println(ret.getCircum());
		System.out.println();
		
		ret = new Ex72_Retangle(3.5, 35.9, "orange");
		System.out.println(ret.width);
		System.out.println(ret.height);
		System.out.println(ret.color);
		System.out.println(ret.getArea());
		System.out.println(ret.getCircum());
		System.out.println();
		
		/*System.out.println(fan.radius);
		System.out.println(fan.speed);
		System.out.println(fan.on);
		System.out.println(fan.color);
		System.out.println();
		
		fan.radius = 10;
		fan.speed = fan.FAST;
		fan.on = "동작중";
		fan.color = "yellow";
		System.out.println(fan.radius);
		System.out.println(fan.speed);
		System.out.println(fan.on);
		System.out.println(fan.color);
		System.out.println();
		
		fan.radius = 5;
		fan.speed = fan.MEDIUM;
		fan.on = "정지";
		fan.color = "blue";
		System.out.println(fan.radius);
		System.out.println(fan.speed);
		System.out.println(fan.on);
		System.out.println(fan.color);
		System.out.println();*/
		
		/*System.out.println(acc.aid);
		System.out.println(acc.balance);
		System.out.println(acc.interestRate);
		System.out.println(acc.dateCreated);
		System.out.println();*/
		
		/*acc.aid = "1122";
		acc.balance = 20000;
		acc.interestRate = 4.5;
		acc.dateCreated = "2014-08-15 14:34:29";
		System.out.println(acc.aid);
		System.out.println(acc.balance);
		System.out.println(acc.interestRate);
		System.out.println(acc.dateCreated);
		acc.getMonthlyInterestRate();
		System.out.println();*/
		
		/*stk.sname = "경영기술";
		stk.currentPrice = 750000;
		stk.previousClosingPrice=1000000;
		
		System.out.println(stk.sname);
		System.out.println(stk.currentPrice);
		System.out.println(stk.previousClosingPrice);*/
		
	} // main

} // class

class Ex72_Retangle{
	double height,width,area,circum;
	String color;
	public Ex72_Retangle() {
		height = 1.0;
		width = 1.0;
		color = "white";
	}
	public Ex72_Retangle(double width,double height, String color){
		this.width = width;
		this.height = height;
		this.color = color;
	}
	double getArea(){
		area = height * width;
		return area;
	}
	double getCircum(){
		circum = (height*2)+(width*2);
		return circum;
	}
} // retangle

class Ex73_Fan{
	final int SLOW, MEDIUM, FAST;
	int speed;
	String on;
	double radius;
	String color;
	public Ex73_Fan() {
		SLOW = 1;
		MEDIUM = 2;
		FAST = 3;
		speed = SLOW;
		on = "false";
		radius = 5.0;
		color = "blue";
	}
	
} //fan

class Ex74_Acconut{
	String aid;
	int balance;
	double interestRate;
	String dateCreated;
	public Ex74_Acconut() {
		aid = "0";
		balance = 0;
		interestRate = 0;
		
	}
	public void getMonthlyInterestRate(){
		System.out.println(interestRate/12);
	}// 월간 이자율 계산
} //account

class Ex75_Stock{
	String sname;
	int previousClosingPrice;
	int currentPrice;
	public Ex75_Stock() {
		
	}
	
} //stock

